<template>
  <div>
    <a-modal v-model="showModel" :title="title" @cancel="handleClose" @ok="handleOk">
      <h1>哈哈哈哈哈</h1>
      <slot name="content"></slot>
      <div style="color: red">
        <slot style="color: red" name="content"> </slot>
      </div>
    </a-modal>
  </div>
</template>

<script>
export default {
  model: {
    prop: 'visible',
    change: 'change'
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '标题'
    }
  },
  data() {
    return {
      showModel: this.visible
    }
  },
  methods: {
    handleOk(e) {
      console.log(e)
      this.$emit('close')
      this.$emit('change', false)
    },
    handleClose(e) {
      this.$emit('changeshow', false)
    }
  },
  watch: {
    visible(o) {
      this.showModel = o
      console.log(o, 9988)
    }
  }
}
</script>
